<link rel="stylesheet" href="/old_styles.css" type="text/css">
<?
$params[sid]=$sid;
$params[action]="view_affiliates";
$url="$baseURL/$webDIR/?".encode_params($params);
$data=get_affiliates_data($resellername);
?>

<table>
<tr>
	<th><?=$resellername?></th>
</tr>
<tr><th><?if($errorMsg) echo "$errorMsg"?></th></tr>
<tr><td>

<form method=post action='<?$url?>'>
<table class='bTable' cellspacing=0>
<tr>
	<th colspan=10> People who are refered by this reseller</th>
</tr>
<tr>
	<th>~</th>
	<th>id</th>
	<th>Affiliate</th>
	<TH>First name: </TH>
	<TH>Last name: </TH>
	<th>E-mail:</th>
	<TH>Country: </TH>
	<th>State</th>
	<th>Address:</th>
</tr>
<?=$data[table_1];?>
<tr>
        <th colspan=10 align=center> <input type='submit' value='Remove Affiliates' > (only removes them as affiliates doesn't block the reseller acc)</th>
</tr>
</table>
<input type='hidden'name='subaction' value='remove_affiliates'>
</form>

<form method=post action='<?$url?>'>
<input type='hidden'name='subaction' value='add_affiliate'>
<table><tr><th align=left>Affiliate id:(ID from reseller system)<br><input type=text name='affiliate_id'>&nbsp;<input type='submit' value='ADD Affiliate'></th></tr></table>
</form>
<br><br>


<form method=post action='<?$url?>'>
<table class='bTable' cellspacing=0>
<tr>
	<th colspan=10>Reseller who has refered this reseller</th>
</tr>
<tr>
        <th>Affiliate</th>
        <TH>First name: </TH>
        <TH>Last name: </TH>
        <th>E-mail:</th>
        <TH>Country: </TH>
        <th>State</th>
        <th>Address:</th>
</tr>
<?=$data[table_2];?>
<tr><th colspan=10><input type='submit' value='Delete referer'></th></tr>
</table>
<input type='hidden'name='subaction' value='remove_referer'>
</form>


<form method=post action='<?$url?>'>
<input type='hidden'name='subaction' value='add_referer'>
<table><tr><th align=left>Referer name (resellername  of that referer):<br><input type=text name='referer'>&nbsp;<input type='submit' value='ADD referer'></th></tr></table>
</form>
<br><br>
</td></tr>
</table>
